package edu.zut.hb.software.admin.service.impl;

import edu.zut.hb.software.admin.dao.UserDao;
import edu.zut.hb.software.admin.domain.User;
import edu.zut.hb.software.admin.service.UserService;
import edu.zut.hb.software.base.service.impl.GenericManagerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;

@Service
@Transactional
public class UserServiceImpl extends GenericManagerImpl<User, Long> implements UserService {

    UserDao userDao;

    @Autowired
    public void setGroupDao(UserDao userDao) {
        this.userDao = userDao;
        this.dao=this.userDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            User user = new User();
            user.setUsername("ww"+i);
            user.setPassword(""+i);
            user.setId(i+1000L);
            list.add(user);
        }
        return list;
    }
}
